package com.fs.erp.api.basedata.entity;

import java.io.Serializable;
import lombok.Data;

/**
 * SPU与销售属性组关系表
 * @TableName base_data_product_poly_sale_prop_group
 */
@Data
public class ProductPolySalePropGroup implements Serializable {
    /**
     * ID
     */
    private String id;

    /**
     * 商品聚合ID
     */
    private String polyId;

    /**
     * 销售属性组ID
     */
    private String salePropGroupId;

    /**
     * 排序
     */
    private Integer orderNo;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ProductPolySalePropGroup other = (ProductPolySalePropGroup) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getPolyId() == null ? other.getPolyId() == null : this.getPolyId().equals(other.getPolyId()))
            && (this.getSalePropGroupId() == null ? other.getSalePropGroupId() == null : this.getSalePropGroupId().equals(other.getSalePropGroupId()))
            && (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getPolyId() == null) ? 0 : getPolyId().hashCode());
        result = prime * result + ((getSalePropGroupId() == null) ? 0 : getSalePropGroupId().hashCode());
        result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", polyId=").append(polyId);
        sb.append(", salePropGroupId=").append(salePropGroupId);
        sb.append(", orderNo=").append(orderNo);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}